package cn.itcast.streaming.utils;

import java.util.Arrays;

public class StringUtil {
    public static String reverse(String orig){
        char[] chars = orig.toCharArray();
        for (int i = 0,j=chars.length-1; i<j; i++,j--) {
            char temp = ' ';
            temp = chars[i];
            chars[i]=chars[j];
            chars[j]=temp;
        }

        return new String(chars);
    }

    public static void main(String[] args) {
        System.out.println(reverse("hello"));
    }

}
